﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class WebUserControl2 : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        tbtest.CssClass = "watermarked";
        tbtest.Attributes.Add("HiddenText","请输入关键字");
        tbtest.Attributes.Add("onfocus", "if(this.value == this.HiddenText){this.value ='';this.className='unwatermarked';}");
        tbtest.Attributes.Add("onblur", "if(this.value == ''){this.value=this.HiddenText;this.className='watermarked';}");
        tbtest.Text = text;
    }

    private string text;

    public string Text
    {
        set
        {
            text = value;
        }
        get
        {
            return text;
        }
    }
    protected void tbtest_TextChanged(object sender, EventArgs e)
    {
        Text = tbtest.Text;
    }
}
